#pragma once
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include<stdlib.h>
#include <fcntl.h>
#include<string.h>
#include<unistd.h>
#define SIZE 1024
#define NOFRUSG 1<<0
#define LINEFRUSH 1<<1
#define QUANFUSH 1<<2

typedef struct MyFile
{
    int fd;
    char buffer[SIZE];
    int flag;      // 标记打开方式
    int bufferlen; // 当前缓冲区大小
    int frush_method;
} MyFile;
static MyFile *mystdout=(MyFile*)sizeof(MyFile);
static MyFile *mystdin=(MyFile*)sizeof(MyFile);
static MyFile *mystderror=(MyFile*)sizeof(MyFile);
 
size_t myfread(void *ptr, size_t size, size_t nmemb, MyFile *stream);
size_t myfwrite(const void *ptr, size_t size, size_t nmemb, MyFile *stream);
MyFile *myfopen(const char *pathname, const char *mode);
int myfclose(MyFile *stream);
int myfflush(MyFile *stream);
void printfbuff(MyFile*stream);
void  Init(MyFile *file, int fdd, int flag);
void add();

